package com.smedi.ismedi.inmail.core.domain.repository;

import com.smedi.ismedi.inmail.core.domain.aggregatemodel.announcement.AnnouncementProjectRelationship;
import com.smedi.ismedi.inmail.core.domain.aggregatemodel.announcement.ProjectReadInfo;

import java.util.List;

/**
 * 项目关系表仓库
 *
 * @author jiangqinxuan
 * @date 2021/07/27
 */
public interface AnnouncementProjectRelationshipRepository {
    /**
     * 新建数据
     *
     * @param announcementProjectRelationship 通知公告与项目关系业务类
     */
    void doInsert(AnnouncementProjectRelationship announcementProjectRelationship);

    /**
     * 查询公告与项目关系是否已经存在
     *
     * @param announcementId 通知公告id
     * @param projectName    项目名字
     * @return Boolean
     */
    Boolean doQueryStatusByAnnouncementIdAndProjectName(Long announcementId, String projectName);

    /**
     * 依据负责的项目id更改已读信息
     *
     * @param projectName    通知公告与主体院关系业务类
     * @param announcementId 通知公告id
     */
    void doUpdateReadByProjectNameAndAnnouncementId(List<String> projectName, Long announcementId);

    /**
     * 依据公告id查询已读信息
     *
     * @param announcementId 通知公告与主体院关系业务类
     * @return OrganizationReadInfo
     */
    ProjectReadInfo doSelectReadInfo(Long announcementId);

    /**
     * 通过项目id查找通知公告id
     *
     * @param projectName 通知公告与主体院关系业务类
     * @return List<Integer>
     */
    List<Long> doSelectByProjectNameList(List<String> projectName);
}
